home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware City / Developers / SliderCDEF1.3.0 / SliderCDEF.h < prev    next >
Encoding:
Text File  |  1994-11-20  |  3.5 KB  |  72 lines  |  [TEXT/MMCC]

  1. // =================================================================================
  2. //    SliderCDEF.h                                ©1993-1994 Harold Ekstrom. All rights reserved.
  3. // =================================================================================
  4.  
  5. #pragma once
  6.  
  7. #ifndef __QDOFFSCREEN__
  8. #include <QDOffscreen.h>
  9. #endif
  10.  
  11. // This structure will be allocated during initialization, and
  12. // a handle to it will be stored in the contrlData field of the
  13. // control record.
  14. typedef struct {
  15.     GWorldPtr            sdTrack;
  16.     GWorldPtr            sdThumb;
  17.     Rect                sdTrackBounds;
  18.     Rect                sdThumbBounds;
  19.     short            sdPosition;
  20.     short            sdDepth;
  21.     short            sdVarCode;
  22. } SliderData, *SliderDataPtr, **SliderDataHnd;
  23.  
  24. // Drawing constants.
  25. #define kStdThumbSize    (40)
  26. #define kStdFont        (geneva)
  27. #define kStdFontSize        (9)
  28. #define kStdFontFace    (0)
  29. #define kThumbShade    (4)
  30.  
  31. // Variation codes. These can be added together to make up
  32. // the variation code for the control, but the variations using
  33. // the title should be used exclusively.
  34. #define kValueAboveCtl    ((short)0x0001)
  35. #define kTitleAfterValue    ((short)0x0002)
  36. #define kTitleBeforeValue    ((short)0x0004)
  37. #define kTitleInTrack    ((short)0x0008)    // Only for horizontal sliders.
  38.  
  39. // Macros.
  40. #define GetSliderData(slider)    ((SliderDataHnd) (**slider).contrlData)
  41. #define IsSliderActive(slider)    (((**slider).contrlHilite == 255) ? false : true)
  42.  
  43. // Prototypes.
  44. pascal long SliderCDEF( short inVarCode, ControlHandle inControl, short inMessage, long inParam );
  45. void SliderDrawControl( short inVarCode, ControlHandle inControl, long inParam );
  46. pascal void SliderBlitControl( short inDepth, short inDeviceFlags, GDHandle inTargetDevice, long inUserData  );
  47. pascal void SliderDrawParts( short inDepth, short inDeviceFlags, GDHandle inTargetDevice, long inUserData  );
  48. void SliderDrawTrack( short inDepth, ControlHandle inControl );
  49. void SliderDrawThumb( short inDepth, ControlHandle inControl );
  50. pascal void SliderDrawValue( short inDepth, short inDeviceFlags, GDHandle inTargetDevice, long inUserData  );
  51. long SliderTestControl( short inVarCode, ControlHandle inControl, long inParam );
  52. void SliderCalcCRgns( short inVarCode, ControlHandle inControl, long inParam );
  53. void SliderInitControl( short inVarCode, ControlHandle inControl, long inParam );
  54. OSErr SliderCreateOffscreenWorld( ControlHandle theControl );
  55. void SliderDisposeControl( short inVarCode, ControlHandle inControl, long inParam );
  56. void SliderPositionControl( short inVarCode, ControlHandle inControl, long inParam );
  57. void SliderThumbControl( short inVarCode, ControlHandle inControl, long inParam );
  58. long SliderDragControl( short inVarCode, ControlHandle inControl, long inParam );
  59. void SliderAutoTrack( short inVarCode, ControlHandle inControl, long inParam );
  60. void SliderCalcCntlRgn( short inVarCode, ControlHandle inControl, long inParam );
  61. void SliderCalcThumbRgn( short inVarCode, ControlHandle inControl, long inParam );
  62. short CalcPosition( ControlHandle inControl );
  63. void CalcDragRect( ControlHandle inControl, Rect *outRect );
  64. void CalcTrackRect( ControlHandle inControl, Rect *outRect );
  65. void CalcThumbRect( ControlHandle inControl, Rect *outRect );
  66. Boolean IsHorizontal( ControlHandle theControl );
  67. short GetDepth( ControlHandle theControl );
  68. void MixColors( const RGBColor *inLight, const RGBColor *inDark, short inShade, RGBColor *outResult );
  69. StringPtr CopyPStr( ConstStr255Param inSourceStr, Str255 outDestStr );
  70. StringPtr ConcatPStr( Str255 ioFirstStr, ConstStr255Param inSecondStr );
  71. StringPtr PrefixPStr( Str255 ioFirstStr, ConstStr255Param inSecondStr );
  72.